AbstractBorder 클래스

✒️ 2025-05-15 14:49 내용 수정


크기가 없는 빈 경계를 구현한 추상 클래스

메서드 설명
void paintBorder(Component c, Graphics g, int x, int y, int width, int height) 주어진 Component의 경계를 그림
Insets getBorderInsets(Component c) 주어진 Component의 경계 안쪽의 여백을 반환
Insets getBorderInsets(Component c, Insets insets) 주어진 Component의 경계 안쪽의 여백을 설정하고 반환

LineBorder 클래스

경계선의 두께와 단일 색을 구현한 클래스

LineBorder 인스턴스이름 = new LineBorder(Color color);
LineBorder 인스턴스이름 = new LineBorder(Color color, int thickness);
LineBorder 인스턴스이름 = new LineBorder(Color color, int thickness, boolean roundedCorners);
메서드 설명
static Border createGrayLineBorder() 두께가 1이고 회색인 경계선 생성
paintBorder(Component c, Graphics g, int x, int y, int width, int height) 주어진 Component의 경계션을 전달 받은 매개변수들로 채색
Insets getBorderInsets(Component c, Insets insets) 주어진 Component의 경계 안쪽의 여백을 설정하고 반환
Color getLineColor() 경계선의 색 반환
int getThickness() 경계선의 두께 반환
boolean getRoundedCorners() 경계선이 둥근 모서리로 생성되었는지 여부를 반환
boolean isBorderOpaque() 경계를 불투명하게 할지를 반환